/**
 * 专门存放公共头部的样式
 *  利用 styled-components 插件 编写局部样式
 */

import styled from 'styled-components'
import logo from '../../static/image/logo.png'

export const HeaderWrapper = styled.div`
    position: relative;
    height: 58px;
    border-bottom: 1px solid #f0f0f0;
`;
// 有了定位，默认就是块级元素，不需要加 display: block
export const Logo = styled.a.attrs({
    href: '/'
})`
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100px;
    height: 56px;
    background: url(${logo});
    background-size: contain;
`;

export const Nav = styled.div`
    width: 945px;
    height: 56px;
    margin: 0 auto;
    padding-right: 70px;
    // 这样添加padding值就不会撑开
    box-sizing: border-size;
`;

export const NavItem = styled.div`
    line-height: 56px;
    padding: 0 15px;
    font-size: 17px;
    color: #333;
    &.left {
     float: left;
    }
    &.right {
     float: right;
     color: #969696;
    }
    &.active {
     color: #ea6f5a
}`;
//搜索框
export const NavSearch = styled.input.attrs({
    placeholder: '搜索'
})`
   width: 160px;
   height: 38px;
   margin-top: 9px;
   border: none;
   outline: none;
   border-radius: 19px;
   margin: 9px 0;
   background: #eee;
   padding: 0 35px 0 20px;
   margin-left: 20px;
  &::placeholder{
      color: #999;
      font-size: 15px;
  }
    //这里使用动画插件
  &.slide-enter{
    transition: all 0.2s ease-out;
  }
  &.slide-enter-active{
      width: 260px;
  }
  &.slide-exit{
    transition: all 0.2s ease-out;
  }
  &.slide-exit-active{
      width: 160px;
  }
  &.focused {
      width: 260px;
  }
`;

//搜索图标
export const SearchWrapper = styled.div`
  position: relative;
  float: left;
  .zoom {
    position: absolute;
    right: 5px;
    bottom: 12px;
    width: 30px;
    line-height: 30px;
    border-radius: 15px;
    text-align: center;
    color: #777;
    &.focused {
        color: #fff;
        background: #999;
    }
   
  }
`
//点击搜索框，弹出搜索信息
export const SearchInfo = styled.div`
    position: absolute;
    left: 0;
    top: 60px;
    width: 200px;
    color: #787878;
    padding: 0 20px;
    box-shadow: 0 0 8px rgba(0, 0, 0, .2);
    background: #fff;
`
export const SearchInfoTitle = styled.div`
  margin-top: 20px;
  margin-bottom: 15px;
  line-height: 20px;
  font-size: 14px;
  color: #969696; 
`
export const SearchInfoSwitch = styled.span`
  float: right;
  font-size: 13px
  .spin{
      display: block;
      float: left;
      font-size: 14px;
      margin-right:5px;
      transition: all 0.2s ease-in;
      transform-origin: center center;
  }
`
export const SearchInfoList = styled.div`
    overflow: hiddle;
    margin-bottom: 15px;
`

export const SearchInfoItem = styled.a`
  display: block;
  float: left;
  font-size: 12px;
  margin-right: 10px;
  margin-bottom: 12px;
  padding: 0 5px;
  line-height: 20px;
  color: #969696;
  border: 1px solid #ddd;
  border-radius: 2px;
`
//右边登陆注册 两个按钮
export const Addition = styled.div`
  position: absolute;
  top: 0;
  right: 62px;
  height: 56px;
`
export const Button = styled.div`
    float: right;
    border: 1px solid rgba(236,97,73,.7);
    border-radius: 20px;
    font-size: 15px;
    color: #ea6f5a;
    height: 38px;
    margin: 9px 15px;
    line-height: 38px;
    text-align: center;
    &.write {
        width: 100px;
        color: #fff;
        background: #ea6f5a;
        vertical-align: middle;
    }
    &.register {
        width: 80px;
    }
`;
